using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("VoteAnswers")]
	[Serializable]
    public class VoteAnswer : DBO<VoteAnswer>
    {
		#region Fields
		
		private int? _IdVoteAnswer;
		private string _VoteAnswerContent;
		private bool? _IsActived;
		private DateTime? _CreatedDate;
		private DateTime? _LastModifiedDate;
		private int? _CountVote;
		private int? _IdVoteQuestion;
		private int? _SortOrder;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public VoteAnswer()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdVoteAnswer 
		/// </summary>
		/// <param name="IdVoteAnswer">The IdVoteAnswer</param>
		public VoteAnswer(int? IdVoteAnswer )
		{
			this.IdVoteAnswer = IdVoteAnswer;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdVoteAnswer">Sets int? value for IdVoteAnswer</param>
		/// <param name="VoteAnswerContent">Sets string value for VoteAnswerContent</param>
		/// <param name="IsActived">Sets bool? value for IsActived</param>
		/// <param name="CreatedDate">Sets DateTime? value for CreatedDate</param>
		/// <param name="LastModifiedDate">Sets DateTime? value for LastModifiedDate</param>
		/// <param name="CountVote">Sets int? value for CountVote</param>
		/// <param name="IdVoteQuestion">Sets int? value for IdVoteQuestion</param>
		/// <param name="SortOrder">Sets int? value for SortOrder</param>
		public VoteAnswer(int? idVoteAnswer, string voteAnswerContent, bool? isActived, DateTime? createdDate, DateTime? lastModifiedDate, int? countVote, int? idVoteQuestion, int? sortOrder)
		{
			this.IdVoteAnswer = idVoteAnswer;
			this.VoteAnswerContent = voteAnswerContent;
			this.IsActived = isActived;
			this.CreatedDate = createdDate;
			this.LastModifiedDate = lastModifiedDate;
			this.CountVote = countVote;
			this.IdVoteQuestion = idVoteQuestion;
			this.SortOrder = sortOrder;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdVoteAnswer
		/// </summary>
		[ColumnAttribute("IdVoteAnswer", SqlDbType.Int , 4 , true, true, false)]
		public int? IdVoteAnswer
		{
			set
			{
				this._IdVoteAnswer = value;
			}
			get
			{
				return this._IdVoteAnswer;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for VoteAnswerContent
		/// </summary>
		[ColumnAttribute("VoteAnswerContent", SqlDbType.NVarChar , 1000 , false, false, true)]
		public string VoteAnswerContent
		{
			set
			{
				this._VoteAnswerContent = value;
			}
			get
			{
				return this._VoteAnswerContent;
			}
		}
		
		/// <summary>
		/// Gets or sets bool? value for IsActived
		/// </summary>
		[ColumnAttribute("IsActived", SqlDbType.Bit , 1 , false, false, true)]
		public bool? IsActived
		{
			set
			{
				this._IsActived = value;
			}
			get
			{
				return this._IsActived;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for CreatedDate
		/// </summary>
		[ColumnAttribute("CreatedDate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? CreatedDate
		{
			set
			{
				this._CreatedDate = value;
			}
			get
			{
				return this._CreatedDate;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for LastModifiedDate
		/// </summary>
		[ColumnAttribute("LastModifiedDate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? LastModifiedDate
		{
			set
			{
				this._LastModifiedDate = value;
			}
			get
			{
				return this._LastModifiedDate;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for CountVote
		/// </summary>
		[ColumnAttribute("CountVote", SqlDbType.Int , 4 , false, false, true)]
		public int? CountVote
		{
			set
			{
				this._CountVote = value;
			}
			get
			{
				return this._CountVote;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdVoteQuestion
		/// </summary>
		[ColumnAttribute("IdVoteQuestion", SqlDbType.Int , 4 , false, false, true)]
		public int? IdVoteQuestion
		{
			set
			{
				this._IdVoteQuestion = value;
			}
			get
			{
				return this._IdVoteQuestion;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for SortOrder
		/// </summary>
		[ColumnAttribute("SortOrder", SqlDbType.Int , 4 , false, false, true)]
		public int? SortOrder
		{
			set
			{
				this._SortOrder = value;
			}
			get
			{
				return this._SortOrder;
			}
		}
		
		
		/// <summary>
		/// Get a VoteQuestion of current VoteAnswer object base on IdVoteQuestion
		/// </summary>
		public VoteQuestion VoteQuestion
		{
			get
			{
				if (this.IdVoteQuestion == null)
					return null;
	
				VoteQuestion condition = new VoteQuestion(this.IdVoteQuestion);
				return VoteQuestionController.FindItem(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdVoteAnswer]
            /// </summary>
            public string IdVoteAnswer
            {
                get
                {
                    return "IdVoteAnswer";
                }
            }
            /// <summary>
            /// Get the name of column [VoteAnswerContent]
            /// </summary>
            public string VoteAnswerContent
            {
                get
                {
                    return "VoteAnswerContent";
                }
            }
            /// <summary>
            /// Get the name of column [IsActived]
            /// </summary>
            public string IsActived
            {
                get
                {
                    return "IsActived";
                }
            }
            /// <summary>
            /// Get the name of column [CreatedDate]
            /// </summary>
            public string CreatedDate
            {
                get
                {
                    return "CreatedDate";
                }
            }
            /// <summary>
            /// Get the name of column [LastModifiedDate]
            /// </summary>
            public string LastModifiedDate
            {
                get
                {
                    return "LastModifiedDate";
                }
            }
            /// <summary>
            /// Get the name of column [CountVote]
            /// </summary>
            public string CountVote
            {
                get
                {
                    return "CountVote";
                }
            }
            /// <summary>
            /// Get the name of column [IdVoteQuestion]
            /// </summary>
            public string IdVoteQuestion
            {
                get
                {
                    return "IdVoteQuestion";
                }
            }
            /// <summary>
            /// Get the name of column [SortOrder]
            /// </summary>
            public string SortOrder
            {
                get
                {
                    return "SortOrder";
                }
            }
        }
        #endregion
    }
}
